package com.test.springboot.springBootUtils.jpa.controller;

import java.util.List;

import com.test.springboot.springBootUtils.aop.OperLog;
import com.test.springboot.springBootUtils.util.OprLogConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.test.springboot.springBootUtils.jpa.bean.Loacation;
import com.test.springboot.springBootUtils.jpa.service.impl.JpaServiceImpl;

@RestController
@RequestMapping("/jpa")
public class JpaController {

	@Autowired
	public JpaServiceImpl jpaServiceImpl;

	@RequestMapping("/findAll")
	@ResponseBody
	@OperLog(operModul = "地市查询",operType = OprLogConst.ADD,operDesc = "地市查询功能")
	public List<Loacation> findAll() {
		return jpaServiceImpl.findAll();
	}

	@RequestMapping("/findAllByPage")
	@ResponseBody
	public Page<Loacation> findAllByPage() {
		return jpaServiceImpl.findAllByPage();
	}

}
